package org.example.Day11.TCP;

import java.io.DataOutputStream;
import java.io.OutputStream;
import java.net.DatagramPacket;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws Exception{
        //创建socket对象
        Socket socket = new Socket("127.0.0.1",8888);
        //从socket通道中得到一个字节输出流
        OutputStream os = socket.getOutputStream();

        //把低级字节流包装成输出流
        DataOutputStream dos = new DataOutputStream(os);

        //写数据出去
        dos.writeUTF("在一起好吗");
        dos.close();

        socket.close();
    }
}
